<?php

namespace Service\AjaxModel;

class PageableResponse
{
    public $items;
    public $page;
    public $max_page;

    public function __construct(array $items, int $page, int $max_page)
    {
        $this->items = $items;
        $this->page = $page;
        $this->max_page = $max_page;
    }

    public static function success(array $items, int $page, int $max_page): AjaxResponse
    {
        return new AjaxResponse(new PageableResponse($items, $page, $max_page));
    }

}

